<div class="nav">
    <ul class="container">
        <li class="category-box" id="J_categoryContainer">
            <?php if ($this->dbTongJiPage == 'index') { ?>
            <div class="link">
                <a href="javascript:;"><?php echo $this->translate('全部商品分类'); ?><i class="triangle-b"></i></a>
            </div>
            <ul class="category">
                <?php
                if ($this->goods_class) {
                foreach ($this->goods_class as $class_key => $class_val) {
                if($class_val['class_state'] == 0) continue;
                ?>
                <li>
                    <?php if ($class_val['class_top_id'] == 0) { ?>
                    <a href="<?php echo $this->url('frontgoodslist/default', array('class_id'=>$class_val['class_id'])); ?>" class="title"><?php echo $this->escapeHtml($class_val['class_name']); ?><i class="fa">&#xf105;</i></a>
                    <?php if (isset($class_val['sub_class']) and !empty($class_val['sub_class'])) { ?>
                        <div class="category-sub">
                            <ul class="sub">
                                <?php foreach($class_val['sub_class'] as $sub_value) { ?>
                                    <li><h5><a href="<?php echo $this->url('frontgoodslist/default', array('class_id'=>$sub_value['class_id'])); ?>"><?php echo $this->escapeHtml($sub_value['class_name']); ?></a></h5></li>
                                <?php } ?>
                            </ul>
                        </div>
                    <?php } ?>
                </div>
                <?php } ?>
                </li>
                <?php } } ?>
                </ul>
            <?php } ?>

        </li>
        <li class="link"><a href="<?php echo $this->url('shopfront/default'); ?>"><?php echo $this->translate('首页'); ?></a></li>
        <?php
        $shop_middle_menu = $this->frontwebsite()->shopFrontMenu(2);
        if(is_array($shop_middle_menu) and !empty($shop_middle_menu)) {
            foreach($shop_middle_menu as $middle_value) {
                ?>
                <li class="link">
                    <a href="<?php echo $middle_value['navigation_url']; ?>" <?php if($middle_value['navigation_new_window'] == 1) echo 'target="_blank"'; ?>><span class="text"><?php echo $middle_value['navigation_title']; ?></span></a>
                </li>
            <?php } } ?>
    </ul>
</div>
<script>
    <?php if($this->dbTongJiPage != 'index') { ?>
    $.get('<?php echo $this->url('shopfront/default',array('action'=>'goodsClass')); ?>',{}, function(html){
        $("#J_categoryContainer").html(html);
    });
    <?php } else { ?>

    <?php } ?>
</script>